using System;
using System.Text;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MSRI.HelperClasses;
using Instedd.Labs.Geo.Library.Kml;
using Mvp.Xml.Common.Xsl;
using System.Xml;
using System.IO;
using System.Xml.Xsl;
using System.Collections.Specialized;
using Instedd.Labs.Geo.Library.Sms;

namespace Instedd.Labs.Geo.Library.Tests.Managers
{
    /// <summary>
    /// Summary description for UnitTest1
    /// </summary>
    [TestClass]
    public class MessagePatternFormatterFixture
    {
        public MessagePatternFormatterFixture()
        {
        }

        [TestMethod]
        public void DecimalLatLongUsingCommasInsteadOfPoinstFormatsUsingPoints()
        {
            MessagePatternFormatter formatter = new MessagePatternFormatter();
            string message = formatter.Format("33,33*44,55*message");

            Assert.AreEqual("33.33*44.55*message", message);
        }

        [TestMethod]
        public void DecimalLatLongAndForgettingLastAsteriskAndHavingNothingCreatesSmsExtension()
        {
            MessagePatternFormatter formatter = new MessagePatternFormatter();
            string message = formatter.Format("33,33*44,55message");

            Assert.AreEqual("33.33*44.55*message", message);
        }

        [TestMethod]
        public void DecimalLatLongAndForgettingLastAsteriskAndSpaceCreatesSmsExtension()
        {
            MessagePatternFormatter formatter = new MessagePatternFormatter();
            string message = formatter.Format("33,33*44,55 message");

            Assert.AreEqual("33.33*44.55*message", message);
        }

        [TestMethod]
        public void DecimalLatLongAndSpacesAroundAsterisksCreatesSmsExtension()
        {
            MessagePatternFormatter formatter = new MessagePatternFormatter();
            string message = formatter.Format("33,33 * 44,55 * message");

            Assert.AreEqual("33.33*44.55*message", message);
        }

        [TestMethod]
        public void DMSLatLongAndForgettingLastAsteriskAndHavingNothingCreatesSmsExtension()
        {
            MessagePatternFormatter formatter = new MessagePatternFormatter();
            string message = formatter.Format("37.28.39.79*122.9.2.13message");

            Assert.AreEqual("37.28.39.79*122.9.2.13*message", message);
        }

        [TestMethod]
        public void DMSLatLongAndForgettingLastAsteriskAndSpaceCreatesSmsExtension()
        {
            MessagePatternFormatter formatter = new MessagePatternFormatter();
            string message = formatter.Format("37.28.39.79*122.9.2.13 message");

            Assert.AreEqual("37.28.39.79*122.9.2.13*message", message);
        }

        [TestMethod]
        public void DMSLatLongAndSpacesAroundAsterisksCreatesSmsExtension()
        {
            MessagePatternFormatter formatter = new MessagePatternFormatter();
            string message = formatter.Format("37.28.39.79 * 122.9.2.13 * message");

            Assert.AreEqual("37.28.39.79*122.9.2.13*message", message);
        }
    }
}